home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995…tember: Reference Library / Dev.CD Sep 95 RL / Dev.CD Sep 95 RL.toast / mac / Technical Documentation / develop / develop Issue 15 code / 3D Interface / Demo3D / U3DDrawing.h < prev    next >
Encoding:
Text File  |  1994-10-21  |  20.0 KB  |  566 lines  |  [TEXT/MPS ]

  1. //----------------------------------------------------------------------------------------
  2. //    File:        U3DDrawing.h
  3. //
  4. //    Contains:    Headers for 3D drawing routines.
  5. //
  6. //    Written by:    Jamie Osborne, Robin Mair, Faulkner White, Henri Lamiraux
  7. //                 Adapted for 3.1.1 by Jeroen Schalk
  8. //
  9. //    Copyright:    © 1992-1994 by Apple Computer, Inc.
  10. //----------------------------------------------------------------------------------------
  11.  
  12. #ifndef __U3DDRAWING__
  13. #define __U3DDRAWING__
  14.  
  15. #ifndef __UCONTROL__
  16. #include <UControl.h>
  17. #endif
  18.  
  19. #ifndef __ICONS__
  20. #include "Icons.h"
  21. #endif
  22.  
  23. //----------------------------------------------------------------------------------------
  24.  
  25. // 8Bit gray shade constants
  26. const     short     kRGB8BitGray1        =    61166;    // Light gray
  27. const    short    kRGB8BitGray2        =    56797;    // Slightly darker gray
  28. const    short    kRGB8BitGray3        =    52428;    // Slightly darker gray
  29. const    short    kRGB8BitGray4        =    48059;    // Slightly darker gray
  30. const    short    kRGB8BitGray5        =    43690;    // Slightly darker gray
  31. const    short    kRGB8BitGray6        =    34952;    // Slightly darker gray
  32. const    short    kRGB8BitGray7        =    30583;    // Slightly darker gray
  33. const    short    kRGB8BitGray8        =    21845;    // Slightly darker gray
  34. const    short    kRGB8BitGray9        =    17476;    // Slightly darker gray
  35. const    short    kRGB8BitGray10        =    8738;    // Slightly darker gray
  36. const    short    kRGB8BitGray11        =    4369;    // Dark gray
  37.  
  38. // 4Bit gray shade constants
  39. const     short    kRGB4BitGray1        =    49152;    // Light gray
  40. const    short    kRGB4BitGray2        =    32768;    // Medium gray
  41. const    short    kRGB4BitGray3        =    8192;    // Dark gray
  42.  
  43. // Some constants for drawing grays
  44. const CRGBColor kLightGray = CRGBColor(kRGB8BitGray1, kRGB8BitGray1, kRGB8BitGray1);
  45. const CRGBColor kLightGray2 = CRGBColor(kRGB8BitGray2, kRGB8BitGray2, kRGB8BitGray2);
  46. const CRGBColor kLightGray4 = CRGBColor(kRGB8BitGray4, kRGB8BitGray4, kRGB8BitGray4);
  47. const CRGBColor kMediumLightGray = CRGBColor(kRGB8BitGray5, kRGB8BitGray5, kRGB8BitGray5);
  48. const CRGBColor kMediumGray = CRGBColor(kRGB8BitGray6, kRGB8BitGray6, kRGB8BitGray6);
  49.  
  50. //----------------------------------------------------------------------------------------
  51. // InitU3DDrawing
  52. // This function initializes the 3D library.  You must call this function in your
  53. // initialization routine.
  54. //----------------------------------------------------------------------------------------
  55.  
  56. void InitU3DDrawing();
  57.  
  58. //----------------------------------------------------------------------------------------
  59. // ••• 3D Utility Classes •••
  60. //----------------------------------------------------------------------------------------
  61.  
  62. //----------------------------------------------------------------------------------------
  63. // CGraphicsState
  64. // A stack-based object that remembers the graphics state (BW and color)
  65. // and restores it when it passes out of scope
  66. //----------------------------------------------------------------------------------------
  67.  
  68. class CGraphicsState
  69. {
  70. private:
  71.     CRGBColor        fSaveForeColor;
  72.     CRGBColor        fSaveBackColor;
  73.     PenState        fSavePenState;
  74.     TextStyle        fSaveTextStyle;
  75.  
  76. public:
  77.     CGraphicsState();
  78.     ~CGraphicsState();
  79.  
  80.     void     Save();
  81.     void    Restore();
  82.  
  83. };    // CGraphicsState
  84.  
  85. //----------------------------------------------------------------------------------------
  86. // CDrawPerDevice
  87. // A stack-based object that allows drawing in different pixel depths across
  88. // different monitors
  89. // If you're not using C++, just use DeviceLoop.  It's faster than CDrawPerDevice
  90. // However, if you are using C++, CDrawPerDevice can save you some headaches
  91. // having to deal with static drawing routines and the like
  92. //----------------------------------------------------------------------------------------
  93.  
  94. class CDrawPerDevice
  95. {
  96. private:
  97.     CRect            fGlobalArea;
  98.     GDHandle        fGDHandle;
  99.     RgnHandle        fSaveClip;
  100.     FocusRec        fFocus;
  101.     Boolean            fDoneOldQD;
  102.  
  103. public:
  104.     CDrawPerDevice();
  105.     CDrawPerDevice(const CRect& area);
  106.     ~CDrawPerDevice();
  107.  
  108.     void     SetDrawingArea(const CRect& area);
  109.     Boolean    NextDevice(short& pixelSize);
  110.  
  111. };    // CDrawPerDevice
  112.  
  113. //----------------------------------------------------------------------------------------
  114. // CPenNormal
  115. // Sets the fore and back color to black and white and calls PenNormal
  116. //----------------------------------------------------------------------------------------
  117.  
  118. void     CPenNormal();
  119.  
  120. //----------------------------------------------------------------------------------------
  121. // ••• 3D TView Adorners •••
  122. //----------------------------------------------------------------------------------------
  123.  
  124. const IDType kGrayBackgroundAdorner        = 'grba';
  125. const IDType kWhiteBackgroundAdorner    = 'whba';
  126. const IDType k3DGrayBackgroundAdorner    = '3dgb';
  127. const IDType k3DLineTopAdorner            = '3dlt';
  128. const IDType k3DLineBottomAdorner        = '3dlb';
  129. const IDType k3DLineLeftAdorner            = '3dll';
  130. const IDType k3DLineRightAdorner        = '3dlr';
  131. const IDType k3DFrameAdorner            = '3dfr';
  132.  
  133. //----------------------------------------------------------------------------------------
  134. // TWhiteBackgroundAdorner
  135. //----------------------------------------------------------------------------------------
  136.  
  137. class TWhiteBackgroundAdorner : public TAdorner
  138. {
  139.     DeclareClass(TWhiteBackgroundAdorner);
  140.  
  141. public:
  142.     TWhiteBackgroundAdorner();
  143.     virtual void        IWhiteBackgroundAdorner(Boolean freeOnDeletion);
  144.     virtual void        Draw(TView* itsView, const VRect& area);
  145. };
  146.  
  147. //----------------------------------------------------------------------------------------
  148. // TGrayBackgroundAdorner
  149. //----------------------------------------------------------------------------------------
  150.  
  151. class TGrayBackgroundAdorner : public TAdorner
  152. {
  153.     DeclareClass(TGrayBackgroundAdorner);
  154.  
  155. public:
  156.     TGrayBackgroundAdorner();
  157.     virtual void        IGrayBackgroundAdorner(Boolean freeOnDeletion);
  158.     virtual void        Draw(TView* itsView, const VRect& area);
  159. };
  160.  
  161. //----------------------------------------------------------------------------------------
  162. // T3DGrayBackgroundAdorner
  163. //----------------------------------------------------------------------------------------
  164.  
  165. class T3DGrayBackgroundAdorner : public TGrayBackgroundAdorner
  166. {
  167.     DeclareClass(T3DGrayBackgroundAdorner);
  168.  
  169. public:
  170.     T3DGrayBackgroundAdorner();
  171.     virtual void        I3DGrayBackgroundAdorner(Boolean freeOnDeletion);
  172.     virtual void        Draw(TView* itsView, const VRect& area);
  173. };
  174.  
  175. //----------------------------------------------------------------------------------------
  176. // T3DLineTopAdorner
  177. //----------------------------------------------------------------------------------------
  178.  
  179. class T3DLineTopAdorner : public TAdorner
  180. {
  181.     DeclareClass(T3DLineTopAdorner);
  182.  
  183. public:
  184.     T3DLineTopAdorner();
  185.     virtual void        I3DLineTopAdorner(Boolean freeOnDeletion);
  186.     virtual void        Draw(TView* itsView, const VRect& area);
  187. };
  188.  
  189. //----------------------------------------------------------------------------------------
  190. // T3DLineBottomAdorner
  191. //----------------------------------------------------------------------------------------
  192.  
  193. class T3DLineBottomAdorner : public TAdorner
  194. {
  195.     DeclareClass(T3DLineBottomAdorner);
  196.  
  197. public:
  198.     T3DLineBottomAdorner();
  199.     virtual void        I3DLineBottomAdorner(Boolean freeOnDeletion);
  200.     virtual void        Draw(TView* itsView, const VRect& area);
  201. };
  202.  
  203. //----------------------------------------------------------------------------------------
  204. // T3DLineLeftAdorner
  205. //----------------------------------------------------------------------------------------
  206.  
  207. class T3DLineLeftAdorner : public TAdorner
  208. {
  209.     DeclareClass(T3DLineLeftAdorner);
  210.  
  211. public:
  212.     T3DLineLeftAdorner();
  213.     virtual void        I3DLineLeftAdorner(Boolean freeOnDeletion);
  214.     virtual void        Draw(TView* itsView, const VRect& area);
  215. };
  216.  
  217. //----------------------------------------------------------------------------------------
  218. // T3DLineRightAdorner
  219. //----------------------------------------------------------------------------------------
  220.  
  221. class T3DLineRightAdorner : public TAdorner
  222. {
  223.     DeclareClass(T3DLineRightAdorner);
  224.  
  225. public:
  226.     T3DLineRightAdorner();
  227.     virtual void        I3DLineRightAdorner(Boolean freeOnDeletion);
  228.     virtual void        Draw(TView* itsView, const VRect& area);
  229. };
  230.  
  231. //----------------------------------------------------------------------------------------
  232. // T3DFrameAdorner
  233. //----------------------------------------------------------------------------------------
  234.  
  235. class T3DFrameAdorner : public TAdorner
  236. {
  237.     DeclareClass(T3DFrameAdorner);
  238.  
  239. public:
  240.     T3DFrameAdorner();
  241.     virtual void        I3DFrameAdorner(Boolean freeOnDeletion);
  242.     virtual void        Draw(TView* itsView, const VRect& area);
  243. };
  244.  
  245. //----------------------------------------------------------------------------------------
  246. // ••• TControl classes and auxiliary adorners •••
  247. //----------------------------------------------------------------------------------------
  248.  
  249. //----------------------------------------------------------------------------------------
  250. // T3DCheckBox
  251. // A 3D version of the check box control.  This class circumvents the control CDEF
  252. //----------------------------------------------------------------------------------------
  253.  
  254. class T3DCheckBox : public TCheckBox
  255. {
  256.     DeclareClass(T3DCheckBox);
  257.  
  258. protected:
  259.     VRect            fDrawBox;
  260.     CRGBColor        fForeColor;
  261.     CRGBColor        fBackColor;
  262.  
  263. public:
  264.     T3DCheckBox()    {this->Initialize();}
  265.     virtual void    Initialize(void);
  266.     virtual void     DoPostCreate(TDocument *itsDocument);
  267.     virtual void     I3DCheckBox (TView* itsSuperView, const VPoint& itsLocation,
  268.                                  const VPoint& itsSize, SizeDeterminer itsHSizeDet,
  269.                                  SizeDeterminer itsVSizeDet, const CStr255& itsLabel,
  270.                                  Boolean isTurnedOn);
  271.     virtual TObject* Clone();
  272.     virtual void     Free();
  273.  
  274.     virtual void     DoMouseCommand(VPoint& theMouse,TToolboxEvent*,CPoint);
  275.     virtual void     TrackMouse(TrackPhase aTrackPhase, VPoint& anchorPoint,
  276.                                 VPoint& previousPoint, VPoint& nextPoint, Boolean);
  277.  
  278.     virtual void    Draw(const VRect& area);
  279.     virtual void     DimState(Boolean state,Boolean redraw);
  280.     virtual void    SetLongVal(VCoordinate itsVal, Boolean redraw);
  281.     virtual void     HiliteState(Boolean state,Boolean redraw);
  282.     virtual void     Hilite();
  283.     virtual void     Dim();
  284.     inline void        SetBackColor(CRGBColor    newColor) {fBackColor = newColor;}
  285.     virtual void     InstallColor(const CRGBColor& theColor, Boolean redraw);
  286.  
  287. private:
  288.     virtual void     DrawBoxText(const CStr255& s, const CRect& box, Boolean preferOutline);
  289.     virtual void    DrawBox();
  290.     virtual void    DrawCheck();
  291.  
  292. };  // T3DCheckBox
  293.  
  294. //----------------------------------------------------------------------------------------
  295. // T3DRadio
  296. // A 3D version of the radio button.  This class circumvents the control CDEF
  297. //----------------------------------------------------------------------------------------
  298.  
  299. class T3DRadio : public TRadio
  300. {
  301.     DeclareClass(T3DRadio);
  302.  
  303. protected:
  304.     VRect            fDrawBox;
  305.     CRGBColor        fForeColor;
  306.     CRGBColor        fBackColor;
  307.  
  308. public:
  309.     T3DRadio()        {this->Initialize();}
  310.     virtual void    Initialize(void);
  311.     virtual void     DoPostCreate(TDocument *itsDocument);
  312.     virtual void     I3DRadio (TView* itsSuperView, const VPoint& itsLocation,
  313.                                 const VPoint& itsSize, SizeDeterminer itsHSizeDet,
  314.                                 SizeDeterminer itsVSizeDet, const CStr255& itsLabel,
  315.                                 Boolean isTurnedOn);
  316.     virtual TObject* Clone();
  317.     virtual void     Free();
  318.  
  319.     virtual void     DoMouseCommand(VPoint& theMouse,TToolboxEvent*,CPoint);
  320.     virtual void     TrackMouse(TrackPhase aTrackPhase, VPoint& anchorPoint,
  321.                                 VPoint& previousPoint, VPoint& nextPoint, Boolean);
  322.  
  323.     virtual void    Draw(const VRect& area);
  324.     virtual void     DimState(Boolean state,Boolean redraw);
  325.     virtual void    SetLongVal(VCoordinate itsVal, Boolean redraw);
  326.     virtual void     HiliteState(Boolean state,Boolean redraw);
  327.     virtual void     Hilite();
  328.     virtual void     Dim();
  329.     inline void        SetBackColor(CRGBColor    newColor) {fBackColor = newColor;}
  330.     virtual void     InstallColor(const CRGBColor& theColor, Boolean redraw);
  331.  
  332. private:
  333.     virtual void     DrawBoxText(const CStr255& s, const CRect& box, Boolean preferOutline);
  334.     virtual void    DrawBox();
  335.     virtual void    DrawCheck();
  336. };
  337.  
  338. //----------------------------------------------------------------------------------------
  339. // T3DButton
  340. // A 3D version of the push button.  This class circumvents the control CDEF
  341. //----------------------------------------------------------------------------------------
  342.  
  343. class T3DButton : public TButton
  344. {
  345.     DeclareClass(T3DButton);
  346.  
  347. protected:
  348.     TAdorner*        f3DAdorner;
  349.     CRGBColor        fHilitedTextColor;
  350.  
  351. public:
  352.     T3DButton()    {this->Initialize();}
  353.     virtual void Initialize(void);
  354.     virtual void DoPostCreate(TDocument *itsDocument);
  355.     virtual void I3DButton(TView* itsSuperView, const VPoint& itsLocation,
  356.                             const VPoint& itsSize, SizeDeterminer itsHSizeDet,
  357.                             SizeDeterminer itsVSizeDet, const CStr255& itsLabel);
  358.     virtual TObject* Clone();
  359.     virtual void Free();
  360.     virtual void CreateButtonAdorner();
  361.  
  362.     virtual void DoMouseCommand(VPoint& theMouse,TToolboxEvent*,CPoint);
  363.     virtual void TrackMouse(TrackPhase aTrackPhase, VPoint& anchorPoint, VPoint& previousPoint,
  364.                                          VPoint& nextPoint, Boolean);
  365.  
  366.     virtual void DimState(Boolean state,Boolean redraw);
  367.     virtual void HiliteState(Boolean state,Boolean redraw);
  368.     virtual void Draw(const VRect& area);
  369.     virtual void Hilite();
  370.     virtual void Dim();
  371.     inline  void SetHilitedTextColor(const CRGBColor& color) { fHilitedTextColor = color; }
  372.  
  373. private:
  374.     virtual void DrawBoxText(const CStr255& s, const CRect& box, Boolean preferOutline );
  375.  
  376. };    // T3DButton
  377.  
  378. //----------------------------------------------------------------------------------------
  379. // T3DTextButtonAdorner
  380. // Adorner used by the T3DButton class for 3D drawing.
  381. //----------------------------------------------------------------------------------------
  382.  
  383. // Round Rect Oval Constants
  384. const short                kOvalWidth            =    10;
  385. const short             kOvalHeight            =    10;
  386.  
  387. const IDType             k3DTextButtonAdorner= '3dtb';
  388.  
  389. class T3DTextButtonAdorner : public TAdorner
  390. {
  391.     DeclareClass(T3DTextButtonAdorner);
  392.  
  393. public:
  394.     T3DTextButtonAdorner()    {};
  395.     virtual void        I3DTextButtonAdorner(Boolean freeOnDeletion);
  396.     virtual void        Draw(TView* itsView, const VRect& area);
  397.  
  398. private:
  399.     virtual void        Draw8Bit(const CRect& rect, Boolean hilite );
  400.     virtual void        Draw4Bit(const CRect& rect, Boolean hilite );
  401.     virtual void        Draw1Bit(const CRect& rect, Boolean hilite );
  402.     virtual void        Frame(const CRect& rect);
  403.     virtual void        TopLeftCorner(const CRect& rect, const CRGBColor light,
  404.                                             const CRGBColor dark, Boolean hilite );
  405.     virtual void        BotLeftCorner(const CRect& rect, const CRGBColor light,
  406.                                             const CRGBColor dark, Boolean hilite );
  407.     virtual void        TopRightCorner(const CRect& rect, const CRGBColor light,
  408.                                             const CRGBColor dark, Boolean hilite );
  409.     virtual void        BotRightCorner(const CRect& rect, const CRGBColor light,
  410.                                             const CRGBColor dark, Boolean hilite );
  411.  
  412. };    // T3DTextButtonAdorner
  413.  
  414. //----------------------------------------------------------------------------------------
  415. // ••• 3DIconButton class and auxiliary adorner •••
  416. //----------------------------------------------------------------------------------------
  417.  
  418. //----------------------------------------------------------------------------------------
  419. // TYPES
  420. //----------------------------------------------------------------------------------------
  421.  
  422. typedef    short ButtonMode;            // Used to store the mode for Icon Buttons
  423.  
  424. //----------------------------------------------------------------------------------------
  425. // CONSTANTS
  426. //----------------------------------------------------------------------------------------
  427.  
  428. const     IDType             k3DIconAdorner             =     '3dia';        // IDType for our adorner
  429. const    Boolean            kButtonOn                =    true;        // State button on
  430. const    Boolean            kButtonOff                =    false;        // State button off
  431. const    ButtonMode        kButtonMode                =    1;            // Normal button Mode for state buttons
  432. const    ButtonMode        kSwitchMode                =    2;            // Toggle Mode for state buttons - default
  433. const    ButtonMode        kRadioMode                =    3;            // Exclusivity Mode for state buttons
  434.  
  435. //----------------------------------------------------------------------------------------
  436. // T3DIconAdorner
  437. // Adorner used by the T3DIconButton class for 3D drawing.
  438. //----------------------------------------------------------------------------------------
  439.  
  440. class T3DIconAdorner : public TAdorner
  441. {
  442.     DeclareClass(T3DIconAdorner);
  443.  
  444. public:
  445.     T3DIconAdorner()    {};
  446.     virtual void        I3DIconAdorner(Boolean freeOnDeletion);
  447.     virtual void        Draw(TView* itsView, const VRect& area);
  448.  
  449. private:
  450.     virtual void        Draw8Bit(const CRect& rect, Boolean hilite);
  451.     virtual void        Draw4Bit(const CRect& rect, Boolean hilite);
  452.     virtual void        Draw1Bit(const CRect& rect,    Boolean hilite);
  453.     virtual void        Frame(const CRect& rect);
  454.     virtual void        TopLeftSide(const CRect& rect);
  455.     virtual void        BotRightSide(const CRect& rect);
  456.     virtual void        TopLeftCorner(const CRect& rect, const CRGBColor light,
  457.                                             const CRGBColor dark );
  458.     virtual void        BotLeftCorner(const CRect& rect, const CRGBColor light,
  459.                                             const CRGBColor dark );
  460.     virtual void        TopRightCorner(const CRect& rect, const CRGBColor light,
  461.                                             const CRGBColor dark );
  462.     virtual void        BotRightCorner(const CRect& rect, const CRGBColor light,
  463.                                             const CRGBColor dark, Boolean hilite );
  464.  
  465. };    // T3DIconAdorner
  466.  
  467. //----------------------------------------------------------------------------------------
  468. // TIconSuite
  469. // Base class for the T3DIconButton.  This class draws icon suites (icl#).
  470. //----------------------------------------------------------------------------------------
  471.  
  472. const EventNumber     mIconSuiteHit            =    1100;        // Hit in an Icon Suite
  473.  
  474. class TIconSuite : public TControl
  475. {
  476.     DeclareClass(TIconSuite);
  477.  
  478. private:
  479.  
  480.     ResNumber                 fIconSuiteRsrcID;        // Resource ID for the family of icons
  481.     IconAlignmentType        fAlignment;                // Type of alignment we would like
  482.     Handle                     fDataHandle;            // Data handle for the icon family
  483.     IconSelectorValue        fSelectorValue;
  484.  
  485. public:
  486.     TIconSuite()    {this->Initialize();}
  487.     virtual void     Initialize ();
  488.     virtual void     IIconSuite (TView* itsSuperView, const VPoint& itsLocation,
  489.                                 const VPoint& itsSize, SizeDeterminer itsHSizeDet,
  490.                                 SizeDeterminer itsVSizeDet, ResNumber itsRsrcID,
  491.                                 IconAlignmentType    alignment, IconSelectorValue selectorValue);
  492.     virtual void     DoPostCreate(TDocument *itsDocument);
  493.  
  494.     virtual TObject* Clone();
  495.     virtual void     Free();
  496.     virtual void     ReleaseIconSuite();
  497.  
  498.     virtual void     GetIconRect(VRect& theRect);
  499.     virtual void     SetIconSuiteRsrcID(short itsRsrcID, IconSelectorValue selectorValue,
  500.                                                 Boolean redraw );
  501.     virtual void     SetIconSuite(Handle theSuite, Boolean redraw );
  502.     virtual void     SetAlignment(IconAlignmentType newAlignment, Boolean redraw );
  503.  
  504.     virtual void     Draw(const VRect& area);
  505.     virtual void     Dim();
  506.     virtual void     Hilite();
  507.  
  508. private:
  509.     virtual void     DoPlotIconSuite(IconTransformType transform);
  510.  
  511. };    // TIconSuite
  512.  
  513. //----------------------------------------------------------------------------------------
  514. // T3DIconButton
  515. // Implementation of 3d Icon button in color where available.
  516. //----------------------------------------------------------------------------------------
  517. const EventNumber     mIconButtonHit            =    1102;        // Hit in an Icon Suite
  518.  
  519.  
  520. class T3DIconButton : public TIconSuite
  521. {
  522.     DeclareClass(T3DIconButton);
  523.  
  524. protected:
  525.     TAdorner*    f3DIconAdorner;            // Reference to the adorner that does
  526.     ButtonMode    fMode;                    // What mode is this button operating under the initial
  527.                                         // possibilities are :     kRadioMode
  528.                                         // kSwitchMode
  529.                                         // kButtonMode
  530.     Boolean        fState;                    // Used to maintain the state of the button during tracking
  531.  
  532. private:
  533.     short        fIconSize;                // Either 12, 16 or 32
  534.  
  535. public:
  536.  
  537.     T3DIconButton() {this->Initialize();};
  538.     virtual void Initialize(void);
  539.     virtual void I3DIconButton(TView* itsSuperView, const VPoint& itsLocation,
  540.                                         const VPoint& itsSize, SizeDeterminer itsHSizeDet,
  541.                                         SizeDeterminer itsVSizeDet, short iconSize,
  542.                                         ResNumber itsRsrcID, ButtonMode mode,
  543.                                         Boolean state );
  544.     virtual void DoPostCreate(TDocument *itsDocument);
  545.     virtual void CreateButtonAdorner ();
  546.  
  547.     virtual void GetIconRect(VRect& theRect);
  548.     virtual void SetIconRsrcID(short itsRsrcID, Boolean redraw );
  549.     virtual void SetMode(ButtonMode newMode);
  550.     virtual ButtonMode GetMode();
  551.     virtual Boolean IsSelected();
  552.     virtual void TrackMouse(TrackPhase aTrackPhase,VPoint& ,
  553.                                     VPoint& , VPoint& nextPoint,Boolean );
  554.     virtual void Hilite();
  555.     virtual void Dim();
  556.  
  557. private:
  558.     virtual short GetIconSize(const VPoint& viewSize);
  559.     virtual void SetIconSuiteRsrcID(short itsRsrcID, IconSelectorValue selectorValue,
  560.                                             Boolean redraw );
  561.     virtual void SetIconSuite(Handle theSuite, Boolean redraw);
  562.  
  563. };    // T3DIconButton
  564.  
  565.  
  566. #endif __U3DDRAWING__